class People {
    constructor(name) {
        this.name = name;
    }
    say() {
        console.log(this.name + "说：大家好才是真的好");
    }
}
new People("666").say();
function show(p) {
    console.log("大圣哪吒姜子牙");
    p.say();
}
let p1 = new People("小明");
p1.say();
show(p1);
let p2 = {
    name: "小红",
    say: function () {
        console.log(this.name + "说：好迪真好");
    }
};
p2.say();
show(p2);
class Dog {
    // any类型 是任意类型
    constructor(name, sex, weigh) {
        this.age = name;
        this.sex = sex;
        this.weigh = weigh;
    }
    eat() {
        console.log(this.age, this.sex, this.weigh);
        this.drink();
        this.sleep();
    }
    drink() {
        console.log("drink");
    }
    sleep() {
        console.log("sleep");
    }
}
let d1 = new Dog(10, true, 100);
console.log(d1.age);
d1.eat();
